<div class="container">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="col-sm-6">
                <span class="glyphicon glyphicon-user">&nbsp;店铺管理&nbsp;</span> <span class="glyphicon glyphicon-chevron-right">&nbsp;店铺商品管理&nbsp;</span>
                <span class="glyphicon glyphicon-chevron-right">&nbsp;{{storeName}}&nbsp;</span>
                <a href="javascript:window.history.go(-1);">返回</a>
            </div>
            <div class="col-sm-6">
                <div class="col-sm-10">
                    <searchfilter selected-filter="selctedFilter" filter-str="filterStr" filter-types="filterTypes"></searchfilter>
                </div>
                <div class="col-sm-2 ">
                    <button type="button" class="btn btn-default" ng-click="registerGoods()">
                        <span class="glyphicon glyphicon-plus">注册商品</span>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <table class="table table-striped" ng-init="getCommodityStore()">
        <tr>
            <th></th>
            <th>商品编号</th>
            <th>商品名称</th>
            <th>库存数量</th>
            <th>现价</th>
            <th>原价</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        <tr ng-repeat="item in commodityStore | filter: myFilter">
            <td>{{$index+startIndex}}</td>
            <td>{{item.commodityNo}}</td>
            <td>{{item.name}}</td>
            <td>{{item.commodityAmont}}</td>
            <td>{{item.commodotyPrice}}</td>
            <td>{{item.realPrice}}</td>
            <td ng-switch="item.type">
                <span ng-switch-when="1">已上架</span>
                <span ng-switch-when="-1">已下架</span>
            </td>
            <td>
                <a href="javascript:;" ng-click="changeCommodityType(item.id,-item.type)" ng-switch="item.type">
            	 <span ng-switch-when="1">下架</span> 
            	 <span ng-switch-when="-1">上架</span>
            	</a> &emsp;
                <a ui-sref="store/goods/manageStore/changePrice({storeName:storeName,id:item.id,commodotyPrice:item.commodotyPrice,realPrice:item.realPrice,storeNo:storeNo})">更改价格</a> &emsp;
                <a ui-sref="store/goods/manageStore/changeAmont({storeName:storeName,id:item.id,commodityAmont:item.commodityAmont,storeNo:storeNo})">更改库存</a> &emsp;
            </td>
        </tr>
    </table>
    <pagination page-size="pageSize" page-no="pageNo" total-size="{{nTotalSize}}" page-nums="{{nPageNums}}" start-index={{startIndex}} end-index={{lastIndex}} refresh-method="getCommodityStore()"></pagination>
</div>